package util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by admin on 2016/10/29 0029.
 */
public class DateUtil {
    public Date strToDate(String str){
        try
        {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            Date date = sdf.parse(str);

            return date;
        }
        catch (ParseException e)
        {
            return null;
        }
    }
    public Long dateToLong(Date date){
        return date.getTime();
    }

}
